#ifndef SOCKET_H_
#define SOCKET_H_

#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <iostream>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
#define MSJ_LENGTH 20

using namespace std;

class Socket {
private:

	int socketId;
	int conex_id;
	struct sockaddr_in struct_socket;
	struct sockaddr_in destino;

public:
	Socket();
	Socket(int);
	Socket(int, string);
	int bindSocket();
	int listenSocket();
	int acceptClient();
	int connectToServer();
	int write(void* msj, size_t);
	int write(void* msj, size_t, int);
	void* read(size_t);
	void* read(size_t, int);
	void closeSocket();
	void closeSocket(int);
	string getIPCliente();
	int setStruct_Socket(string ip);
	string getIPServer();
	int getSocketId();
};

#endif /* SOCKET_H_ */
